<?php
/**
 *  NevuxBB - Free Forum Software
 *  Copyright (C) 2008, 2010 NevuxBB (No one specific author)*  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Navigation Generation Class
 * File: breadcrumb_class.php
 * Purpose: Generating the navigation of the forums
 * Todo: Complete this file
 *
 */

class CoreBreadCrumb {
	
	public function generateNav($data) {
		// generate the navigation/breadcrumb
		if($data['settings']['level_down'] === true) {
			// drop a level down in the directory structure
			$main_dir = '../';
		} else {
			$main_dir = '/';
		}
		
		$i = 0;
		foreach($data['information'] as $value) {
			// is this the first navigation part?
			if($i > 0) {
				$final_string .= ' &raquo; ';
			}
			
			// see what information we've been given
			if(!$value['data'][3]) {
				// has no optional information
				$final_string .= '<a href="' . urlSystem::navParts($value['data'][2]) . '" class="breadcrumb">' . $value['data'][1] . '</a>';
			} else {
				// has optional information
				$final_string .= '<a href="' . urlSystem::viewUrl($value['data'][2], $value['data'][3]) . '" class="breadcrumb">' . $value['data'][1] . '</a>';
			}
			
			$i++;
		}
		
		// output this variable
		return $final_string;
	}
		
}
?>